
Private Sub test_SQLTranslateRealTableInfo_base()
    Dim tableNameToken As SqlToken
    Set tableNameToken = New SqlToken
    tableNameToken.Init "table1", SqlTokenType.STR_NAME

    Dim tableAliasNameToken As SqlToken
    Set tableAliasNameToken = New SqlToken
    tableAliasNameToken.Init "t1", SqlTokenType.STR_NAME

    ' SqlTranslateRealTableInfo 初始化
    Dim realTableInfo As SqlTranslateRealTableInfo
    Set realTableInfo = New SqlTranslateRealTableInfo
    realTableInfo.Init tableNameToken

    Dim tableInfo As ISqlTranslateTableInfo
    Set tableInfo = realTableInfo

    ' 未设置别名时获取别名
    Debug.Assert tableInfo.getAliasName() = ""

    ' 设置别名 token 后，再获取别名
    tableInfo.setAliasNameToken tableAliasNameToken
    Debug.Assert tableInfo.getAliasName() = "t1"

    ' 获取原始名称
    Debug.Assert tableInfo.getOriginTableName() = "table1"

    ' 未设置转换后名称时，获取到的[转换后名称]就是表的原始名称
    Debug.Assert tableInfo.getTranslatedTableName() = "table1"

    ' 设置转换后名称
    tableInfo.setTranslatedTableName "XXXXX"
    Debug.Assert tableInfo.getTranslatedTableName() = "XXXXX"
End Sub